package com.zadtek.jpsqishi.activity;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ImageView;
import android.widget.TextView;

import com.zadtek.jpsqishi.R;
import com.zadtek.jpsqishi.activity.common.Const;

/**
 * 管理细则
 * @author Administrator
 *
 */
public class ManagementRules extends Activity {
	private ImageView backid;
	private TextView topview;
	private WebView webview;
	String titleurl=Const.mURL+"/mobile/help";
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.managementrules);
		
		backid = (ImageView) findViewById(R.id.backid);
		topview = (TextView) findViewById(R.id.topview);
		topview.setText("管理细则");

		
		webview =(WebView) findViewById(R.id.management);
		
//		Bundle bundle = getIntent().getExtras();
//		if (bundle != null) {
//			titleurl = bundle.getString("url");
//		}


		backid.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				// TODO Auto-generated method stub
				ManagementRules.this.finish();

			}
		});

		webview.loadUrl(titleurl);

		// 覆盖WebView默认使用第三方或系统默认浏览器打开网页的行为，使网页用WebView打开
		webview.setWebViewClient(new WebViewClient() {
			@Override
			public boolean shouldOverrideUrlLoading(WebView view, String url) {
				// TODO Auto-generated method stub
				// 返回值是true的时候控制去WebView打开，为false调用系统浏览器或第三方浏览器
				view.loadUrl(url);
				return true;
			}
		});
	}
}
